package com.ga.wact.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by 幻夜~星辰 on 2018/10/17.
 * 字符串转为年份
 */
public class StrToYear {

    public static Date StringToYear(String time) throws Exception {
        if (time==null||time==""){
            return new SimpleDateFormat("yyyy-MM-dd").parse("1800-01-01");
        }else {
            return new SimpleDateFormat("yyyy-MM-dd").parse(time);
        }
    }
}
